/*
 * memset_s.c - Safe memory set with bounds checking
 */

#include "bounds_check.h"
#include "bounds_check_internal.h"
#include <string.h>

int memset_s(void *dest, size_t dest_size, int value, size_t count) {
    if (!is_valid_buffer(dest, dest_size)) {
        return BOUNDS_CHECK_INVALID_PARAM;
    }

    if (count > dest_size) {
        return BOUNDS_CHECK_BUFFER_TOO_SMALL;
    }

    memset(dest, value, count);
    return BOUNDS_CHECK_SUCCESS;
}